package cn.com.sassali.staticproxy;

import cn.com.sassali.service.IUserService;

/**
 * @ClassName UserServiceStaticProxy
 * @Description     静态代理
 * @Author lujiansen
 * @date 2020/4/26 1:49 下午
 */
public class UserServiceStaticProxy implements IUserService {

    private IUserService userService;

    public String saveUser(String userId) {
        System.out.println("代理中执行，调用方法前，可开启事务之类的 ======= " + userId);
        userId = userId + "--1";
        userService.saveUser(userId);
        System.out.println("代理中执行，调用方法后，可关闭事务之类的 ======= " + userId);
        return userId;
    }

    public UserServiceStaticProxy(IUserService userService) {
        this.userService = userService;
    }

}
